package com.crape.admin.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import com.crape.account.bo.IAccountBO;
import com.crape.common.model.Account;

@Controller
public class AdminController {

    private IAccountBO accountBOImpl;

    @Autowired
    public void setAccountBOImpl(IAccountBO accountBOImpl) {
        this.accountBOImpl = accountBOImpl;
    }

    @RequestMapping("/admin/index.jsp")
    public String listAccount(ModelMap modelMap, Account account) {
        List<Account> accountList = accountBOImpl.findAccounts(account);
        modelMap.put("account", account);
        modelMap.put("accountList", accountList);
        return "/admin/index.html";
    }
}
